<template>
	<div class="theme">
		<van-nav-bar title="选择节点" left-arrow @click-left="onClickLeft" right-text="保存" @click-right="onClickRight" />
		<div class="overlay headTop">
			<div class="overlay-content scrolling">
				<div style="padding: 15px 0px 10px 15px;color: rgb(125, 126, 128);">
					production
				</div>
				<div style="background-color: white;border-bottom: 1px solid rgb(235, 237, 240);">
					<van-radio-group v-model="radio">
						<van-cell-group>
							<van-cell title="lfjlahfahglaga" clickable @click="radio = '1'">
								<van-radio slot="right-icon" name="1" />
							</van-cell>
							<van-cell title="fasdgoqhaghdaskglaga2" clickable @click="radio = '2'">
								<van-radio slot="right-icon" name="2" />
							</van-cell>
						</van-cell-group>
					</van-radio-group>
				</div>
			</div>
		</div>
		<div style="position: absolute;bottom: 0px;background: white;color: #108CE9;width: 100%;text-align: center;padding: 20px 0px;" @click="addSelect">
			添加自定义节点
		</div>
		<van-dialog v-model="show" title="清输入有效的节点地址" :show-confirm-button="false" style="background: rgb(245, 245, 245);border-radius: 5px;">
			<div align="center" style="font-size: 12px;color: rgb(125, 126, 128);padding: 10px 0px;">
				<span>当前节点为ETHEVE,网络为https</span>
				<van-field v-model.trim="value" maxlength="50" style="padding: 5px 15px;margin: 15px 20px;width: auto;"/>
			</div>
			<div style="background: white;color: #108CE9;" align="center">
				<van-row style="padding: 10px 0px;">
				  <van-col span="12" style="border-right: 1px solid rgb(245, 245, 245);" @click="qx">取消</van-col>
				  <van-col span="12" @click="sure">确认</van-col>
				</van-row>
			</div>
		</van-dialog>
	</div>
</template>

<script>
	let _this;
	export default {
		name: 'SelectNodeSetup',
		components: {},
		props: {},
		data() {
			return {
				radio: '1',
				show: false,
				value: ''
			};
		},
		beforeCreate() {
			_this = this;
		},
		watch: {},
		computed: {},
		methods: {
			onClickLeft() {
				this.$router.push({
					path: '/NodeSetup'
				});
			},
			onClickRight() { // 保存
				this.$toast("保存成功");
				this.$router.push({
					path: '/NodeSetup'
				});
			},
			addSelect() { // 添加自定义节点
				this.show = true;
			},
			qx() {
				this.show = false;
			},
			sure() { // 确认
				if(!this.value) {
					this.$toast("节点地址不能为空");
					return false;
				}
				this.show = false;
				this.$toast("节点地址添加成功");
				this.value = '';
			}
		},
		created() {},
		mounted() {},
		destroyed() {

		},
		filters: {}
	};
</script>

<style lang="less" scoped>
	.overlay {
		background: rgb(245, 245, 245);
	}
</style>